home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d16 / wincomm5.arc / DLGDEMO1.WMS < prev    next >
Text File  |  1990-10-25  |  25KB  |  716 lines

  1. ;First dialog box demo Macro
  2.  
  3. STOP
  4.  
  5. list1$ = "list2.txt"
  6. var1$ = ""
  7. var10$ = "~~temp.txt"
  8. STOP
  9. macro$ = GETSESSSTR(28)
  10. CHGDIR(macro$)
  11. MACROHALT(1)
  12.  
  13.   m0 = menubar?
  14.   m1 = addbar
  15.         addcommand(m1,2,"&WinComm Menu")
  16.   sm1 = addmenu(m1,"&Dialog Boxes")
  17.         addcommand(sm1,3,"F&LIST && VTEXT")
  18.         addcommand(sm1,4,"&File Selection")
  19.         addcommand(sm1,5,"M&ail")
  20.         addcommand(sm1,6,"&Other Samples")
  21.   sm2 = addmenu(m1,"&Graphic Menu")
  22.         addcommand(sm2,7,"Maps")
  23. step
  24. showbar(m1)
  25.  
  26.    DIALOGBOX 71, 20, 235, 107, 21, "Graphics - Menu Bar - Dialog Boxes"
  27.       LTEXT 7, 10, 219, 33, "This part of the TOUR will demonstrate several methods WinComm provides for data entry and option selection.  Notice the Menu Bar has changed to allow different selections in this part of the Tour."
  28.       LTEXT 7, 42, 221, 33, "Select each menu item and explore the many capabilities of WinComm.  When you are finished, select WinComm Menu to halt this macro and redisplay WinComms normal Menu Bar."
  29.       DEFCANCELBUTTON 90, 81, 50, 14, "&OK"
  30.    DEND
  31. DO i = DIALOG? UNTIL(i != 255)
  32.  
  33. main_loop:
  34.   i = menu?
  35.   if(i==2) gosub win_return
  36.   else if(i==3) gosub flist_vtext
  37.   else if(i==4) gosub fil_sel
  38.   else if(i==5) gosub mail
  39.   else if(i==6) gosub next
  40.   else if(i==7) gosub maps
  41. GOTO main_loop
  42.  
  43. ;******  Dialog Boxes|FLIST & VTEXT  *
  44.  
  45. flist_vtext:
  46.  
  47.    DIALOGBOX 10, 14, 274, 162, 17
  48.       CTEXT 86, 6, 77, 9, "Dialog Box Example"
  49.       LTEXT 12, 15, 234, 19, "This dialog box is used to demonstrate the various types of controls that can be used within WinComm dialog boxes."
  50.       FLISTBOX 8, 63, 155, 33, LIST1$, VAR2$
  51.       LTEXT 12, 37, 151, 24, "This is a File Linked List box which displays a list of items contained in a text file."
  52.       LTEXT 11, 98, 153, 40, "When an Item is selected in the list box, the value of DIALOG? changes and the selected text is assigned to a variable.  This Macro places that string in the Variable Text box below."
  53.       VTEXT 10, 143, 150, 9, VAR2$
  54.       LTEXT 170, 36, 89, 17, "The list displayed is contained in the file:"
  55.       VTEXT 180, 57, 63, 10, LIST1$
  56.       GROUPBOX 166, 30, 1, 126, ""
  57.       LTEXT 171, 70, 87, 31, "which the Macro can change by selecting the Update Pushbutton below."
  58.       GROUPBOX 7, 30, 261, 5, ""
  59.       UPDATEPB 177, 105, 78, 14, "&Update Pushbutton"
  60.       DEFPUSHBUTTON 177, 136, 78, 14, "&OK"
  61.       GROUPBOX 170, 123, 98, 5, ""
  62.       GROUPBOX 9, 136, 153, 18, ""
  63.       GROUPBOX 177, 49, 69, 20, ""
  64.    DEND
  65.  
  66. test:                   ;DIALOG? returns 255 while there is no activity in the 
  67.                         ;dialog box.  DIALOG? is reset each time it is tested
  68. DO                      ;so its value must be assigned to a variable for processing
  69. i = DIALOG?             ;If a pushbutton is selected or something in a list box
  70. UNTIL(i != 255)         ;is selected, the value will change and the macro 
  71.                         ;will fall through this loop
  72.  
  73.  
  74.                 ;code below tests for the selection of an UPDATEPUSHBUTTON
  75.                 ;DIALOG? returns 100 for the first  UPDATEPUSHBUTTON
  76.                 ;101 for the second up to a maximum of 103 for the fourth
  77. IF(i == 100){                                                           
  78.     IF(CMP(list1$,"list2.txt") == FALSE)list1$ = "list2.txt"
  79.         ELSE list1$ = "list1.txt"
  80.         UPDATEDLG(17)           ;Updates both the VETEXT and LIST BOX
  81.         GOTO test
  82. }
  83.  
  84.                 ;Tests for a selection in the List Box 
  85.                 ;DIALOG? returns 200 for the first  (F)LISTBOX
  86.                 ;101 for the second up to a maximum of 103 for the fourth
  87. IF(i == 200){
  88.         UPDATEDLG(16)           ;Updates only VETEXT
  89.         GOTO test
  90. }
  91. RETURN                ;goes back to menu processing if neither the UPDATEPB or LISTBOX selected
  92.  
  93. ;***** Dialog Boxes|File Selection **
  94. fil_sel:
  95.  
  96.    ftmp$ = "dlgdmo.fil"
  97.    b$ = "AGNY.DOC"
  98.    fdescr$ = "General Information - Directory of Oklahoma Agencies"    ;causes this item to be
  99.                                     ;selected in the list box
  100.  
  101.    DIALOGBOX 57, 10, 199, 194, 17
  102.       CTEXT 45, 4, 108, 8, "Files Available on ORIGINS:"
  103.       CTEXT 96, 13, 71, 9, "File Description:"
  104.       VTEXT 77, 26, 115, 62, FDESCR$
  105.       UPDATEPB 29, 97, 62, 14, "&Receive File"
  106.       UPDATEPB 111, 97, 62, 14, "&Cancel"
  107.       FLISTBOX 8, 25, 64, 65, FTMP$, B$
  108.       LTEXT 5, 121, 190, 41, "This is an example of one use of the FLISTBOX and the code required to update the description when a file is selected.  Select different files and notice the discription change.  The pushbuttons above are not active."
  109.       DEFPUSHBUTTON 65, 169, 69, 14, "&OK"
  110.       CTEXT 20, 13, 41, 9, "File Name:"
  111.       GROUPBOX 7, 111, 186, 5, ""
  112.       GROUPBOX 75, 21, 120, 68, ""
  113.    DEND
  114.  
  115. testy:          
  116.                 
  117. DO i = DIALOG? UNTIL(i != 255)    ;this line has 3 statements but works just like the three lines
  118.                 ;under the label "test"
  119.  
  120. IF(i == 100){        ;UPDATEPB pressed but don't do anything
  121. UPDATEDLG(0)        ;resets DIALOG?
  122. GOTO testy
  123. }
  124. IF(i == 101){        ;the other UPDATEPB pressed but don't do anything
  125. UPDATEDLG(0)            ;resets DIALOG?
  126. GOTO testy
  127. }
  128.                 
  129. IF(i == 200){            ;file selected in list box,
  130. fdescr$ = EXTRACT(CHAR(9),b$,2)    ;extract description and display it.  
  131. UPDATEDLG(16)            ;Updates VETEXT
  132. GOTO testy
  133. }
  134. return            ;go back to menu processing
  135.  
  136. ;**** Dialog Boxes|Mail **
  137. mail:
  138.  
  139. date$ = left(strtime(time?),10)
  140. time$ = mid(strtime(time?),12,8)
  141. mail$ = "mail.txt"
  142. TO$ = ""
  143. SUBJ$ = ""
  144.  
  145.    DIALOGBOX 53, 10, 230, 212, 17
  146.       LTEXT 103, 4, 18, 9, "Mail"
  147.       RTEXT 18, 18, 21, 9, "To:"
  148.       EDIT 40, 15, 175, 13, TO$
  149.       RTEXT 7, 33, 32, 9, "Subject:"
  150.       EDIT 40, 31, 175, 13, SUBJ$
  151.       RTEXT 19, 49, 20, 9, "Date:"
  152.       EDIT 40, 47, 75, 13, DATE$
  153.       RTEXT 119, 49, 20, 9, "Time:"
  154.       EDIT 140, 47, 75, 13, TIME$
  155.       SEDIT 8, 64, 216, 57, MAIL$
  156.       DEFPUSHBUTTON 36, 123, 71, 15, "&Save"
  157.       CANCELBUTTON 123, 123, 72, 15, "&Discard"
  158.       GROUPBOX 5, 138, 221, 5, ""
  159.       LTEXT 9, 143, 212, 35, "This dialog box shows two other types of controls. The framed rectangles are EDIT boxes and allow text entry and editing.  The box with the vertical scroll bar is also an EDIT box but its contents are stored in a disk file which can be"
  160.       LTEXT 9, 175, 210, 35, "up to 16,000 characters in length.  Create a mail message by filling in the blanks and check the SAVE button.  After this dialog box disappears the Macro will display one of WinComms 'stock' dialog boxes for naming the mail file."
  161.    DEND
  162.  
  163. DO i = DIALOG? UNTIL(i != 255)
  164.  
  165. IF(i == 0){
  166.    DIALOGBOX 77, 21, 154, 87, 17
  167.       LTEXT 7, 7, 140, 33, "You don't want to save a Mail message this time?  If you haven't saved one yet you won't be able to read it later in the demonstration."
  168.       DEFPUSHBUTTON 24, 44, 99, 14, "&OK I Will Send Mail"
  169.       CANCELBUTTON 24, 62, 100, 14, "&Lets Go On"
  170.    DEND
  171.         DO j = DIALOG? UNTIL(j != 255)
  172.         IF(j == 0)RETURN            ;go back to menu processing
  173.         ELSE GOTO mail
  174. }
  175. ELSE IF(i == 1){
  176.  
  177.  
  178.         mail_mess = FOPEN(4096,"~~temp.txt")    ;create a temp file
  179.  
  180.         mail = FOPEN(2,mail$)              ;open the file created by the SEDIT box
  181.         FWRITELN(mail_mess,to$)                  ;add information to the temp file
  182.         FWRITELN(mail_mess,subj$)
  183.         FWRITELN(mail_mess,date$)
  184.         FWRITELN(mail_mess,time$)
  185.         DO
  186.         str$ = FREAD(mail,255)          ;copy the mail file to the temp file for display
  187.         FWRITE(mail_mess,255,str$)
  188.         UNTIL(NULL(str$) == TRUE)        ;everything copied
  189.         FCLOSE(mail_mess)
  190.         FCLOSE(mail)
  191.         DELETEFILE("mail.txt")
  192.         a$ = ".MLE"
  193.                 IF(SAVEASDLG("Save Mail Message as what File Name",a$) == FALSE){
  194.                    DIALOGBOX 77, 21, 154, 87, 17
  195.                       LTEXT 7, 7, 140, 33, "You don't want to save a Mail message this time?  If you haven't saved one yet you won't be able to read it later in the demonstration."
  196.                       DEFPUSHBUTTON 24, 44, 99, 14, "&OK I Will Send Mail"
  197.                       CANCELBUTTON 24, 62, 100, 14, "&Lets Go On"
  198.                    DEND
  199.                    DO j = DIALOG? UNTIL(j != 255)
  200.                    IF(j == 0){
  201.             DELETEFILE("~~temp.txt")
  202.             RETURN
  203.            }
  204.                    ELSE GOTO mail
  205.                 }
  206.                 ELSE RENAME("~~temp.txt",a$)
  207. }
  208.  
  209. IF(FILEOPENDLG("Select Mail File For Reading","*.mle",var2$) == FALSE)RETURN  ;cancel selected go back to menu
  210. GOSUB extract
  211. var11$ = "~~temp.txt"
  212.    DIALOGBOX 53, 10, 230, 202, 17
  213.       LTEXT 103, 4, 18, 9, "Mail"
  214.       RTEXT 18, 18, 21, 9, "To:"
  215.       VTEXT 43, 18, 175, 9, TO$
  216.       RTEXT 7, 33, 32, 9, "Subject:"
  217.       VTEXT 43, 33, 175, 9, SUBJ$
  218.       RTEXT 19, 49, 20, 9, "Date:"
  219.       VTEXT 42, 49, 72, 9, DATE$
  220.       RTEXT 119, 49, 20, 9, "Time:"
  221.       VTEXT 143, 49, 75, 9, TIME$
  222.       STEXT 10, 62, 215, 58, VAR11$
  223.       UPDATEPB 36, 123, 71, 15, "&Read Another"
  224.       CANCELBUTTON 123, 123, 72, 15, "&Finished"
  225.       GROUPBOX 5, 138, 221, 5, ""
  226.       LTEXT 9, 144, 212, 33, "This is an example of a dialog box for reading mail.  The text box with the vertical scroll bar in this case is a STEXT box which is read only.  The [Read Another] button is an UPDATEPB which displays a 'Stock Dialog Box' that allows"
  227.       LTEXT 9, 176, 210, 24, "selection of another Mail file.  When the new mail file is selected, this dialog box is updated with the information in the selected file."
  228.       GROUPBOX 40, 12, 183, 16, ""
  229.       GROUPBOX 40, 27, 183, 16, ""
  230.       GROUPBOX 141, 43, 82, 16, ""
  231.       GROUPBOX 40, 43, 77, 16, ""
  232.    DEND
  233. read_mail:
  234. DO i = DIALOG? UNTIL(i != 255)
  235. IF(i == 100){
  236.         DELETEFILE("~~temp.txt")   ;make for shure we get rid of that temp file
  237.         IF(FILEOPENDLG("Select Mail File For Reading","*.mle",var2$) == FALSE){
  238.         GOTO read_mail
  239.         }
  240.         GOSUB extract
  241.         GOTO read_mail
  242.  
  243. }
  244. DELETEFILE("~~temp.txt")        ;that temp file better be gone by now!!!
  245. RETURN                ;finished--back to menu processing
  246.  
  247.  
  248. ;***** Subroutine **
  249.  
  250.  
  251. extract:                        ;Subroutine to remove information fron the front of the mail file
  252.                                 ;for display in the Read Mail Dialog box.
  253. mail = FOPEN(2,var2$)           ;open the file selected in the FILEOPENDLG dialog box
  254. to$ = FREADLN(mail)             ;extract information from the mail file and assign
  255. subj$ = FREADLN(mail)           ;to the proper variables
  256. date$ = FREADLN(mail)           
  257. time$ = FREADLN(mail)
  258. mail_mess = FOPEN(4096,"~~temp.txt")
  259. DO
  260.         str$ = FREAD(mail,255)          ;copy the rest of the mail file to a temprary file for display
  261.         FWRITE(mail_mess,255,str$)
  262. UNTIL(NULL(str$) == TRUE)
  263. FCLOSE(mail)
  264. FCLOSE(mail_mess)
  265. UPDATEDLG(18)
  266. RETURN
  267.  
  268. ;****** Dialog Boxes|Other Samples **
  269. next:
  270. var1$ = ""
  271. spec$ = "spec.txt"    ;assign the variable for the file to display in the FLIST box
  272.  
  273.    DIALOGBOX 90, 15, 185, 181, 17
  274.       LTEXT 52, 6, 81, 9, "Your current status"
  275.       GROUPBOX 10, 13, 164, 35, "In training"
  276.       CHECKBOX 19, 24, 42, 10, "Intern", VAR1
  277.       CHECKBOX 19, 36, 49, 10, "Resident", VAR2
  278.       CHECKBOX 90, 24, 66, 10, "Chief resident", VAR3
  279.       CHECKBOX 90, 36, 47, 10, "Fellow", VAR4
  280.       GROUPBOX 10, 50, 164, 48, "In practice"
  281.       CHECKBOX 19, 61, 71, 10, "Administration", VAR5
  282.       CHECKBOX 19, 73, 46, 10, "Academic", VAR6
  283.       CHECKBOX 19, 86, 56, 10, "Military", VAR7
  284.       CHECKBOX 90, 61, 68, 10, "Private/group", VAR8
  285.       CHECKBOX 90, 73, 68, 10, "Locum tenens", VAR9
  286.       CHECKBOX 90, 86, 83, 10, "Contract Professional", VAR10
  287.       CHECKBOX 10, 105, 43, 10, "Other...", VAR11
  288.       EDIT 56, 103, 118, 12, VAR1$
  289.       LTEXT 48, 118, 93, 9, "Select your specialty"
  290.       FLISTBOX 10, 128, 166, 32, SPEC$, VAR2$
  291.       DEFPUSHBUTTON 54, 157, 77, 14, "&OK"
  292.    DEND
  293. cont1:
  294. DO dg = dialog? UNTIL(dg != 255)
  295. IF(DG == 200){            ;something selected in list box but we don't do anything with it here
  296. UPDATEDLG(0)
  297. GOTO cont1
  298. }
  299. ELSE return            ;finished with this, process those menus
  300.  
  301. ;****** WinComm Menu **
  302. win_return:        ;somebody wants to go back to wincomms menu
  303. SHOWBAR(m0)
  304. OPEN("TOUR.WSF","",0)
  305. HALT
  306. ;******* Graphic Menu|Maps **
  307. maps:
  308. ENABLEMENU(m1,2,1)    ;disable all menu items while running the hotspot program
  309. ENABLEMENU(m1,3,1)    ;the menus do not need to be disabled and could be fully
  310. ENABLEMENU(m1,4,1)    ;functional, as the macro could continue to process MENU? 
  311. ENABLEMENU(m1,5,1)    ;but for a demo what do you want?
  312. ENABLEMENU(m1,6,1)
  313. ENABLEMENU(m1,7,1)
  314. SHOWBAR(m1)
  315. show(1)
  316. OPEN("GRAPHIC.WSF","",0)
  317.    DIALOGBOX 87, 27, 201, 106, 21, "Button and Graphics Demo"
  318.       LTEXT 16, 9, 169, 25, "This part of the Tour will allow you to make selections of Cities and States from a map."
  319.       LTEXT 17, 40, 165, 34, "Select a region, then select Cities and States by clicking on the names.  Click on USA Map then Complete to finish this part of the demo."
  320.       DEFPUSHBUTTON 73, 79, 50, 14, "OK"
  321.    DEND
  322. DO i = DIALOG? UNTIL(i != 255)
  323.  
  324. FCLOSE(FOPEN(4096,macro$+"\fill.txt"))    ;create a file called fill.txt
  325. Var1$ = macro$+"\fill.txt"
  326. first = 1
  327. vra2$ = ""
  328.  
  329.  
  330. USA:
  331. DELOBJECT(0,0,0)
  332. USERWINDOW(5,0,100,16776960)
  333. METABKG(0,0,1,"us_color.wmf")
  334.     BUTTON(-81,2459,1258,590,"1001,&WEST")
  335.     BUTTON(2016,2276,1259,590,"1002,MOU&NTAIN")
  336.     BUTTON(4208,3089,1259,570,"1003,&PLAINS")
  337.     BUTTON(3708,5366,1258,589,"1004,&TEXAS")
  338.     BUTTON(825,7439,1259,589,"1005,&ALASKA")
  339.     BUTTON(4357,8455,1259,590,"1006,&HAWAII")
  340.     BUTTON(6179,2707,1258,586,"1007,MID&WEST")
  341.     BUTTON(6101,4951,1257,586,"1008,SO&UTH")
  342.     BUTTON(8035,1488,1415,585,"1009,NO&RTHEAST")
  343.     BUTTON(7930,3496,1420,589,"1010,S&OUTHEAST")
  344. SHOW(6)
  345.  
  346. if(first==1){
  347.       first = 0
  348.       GOTO us_test
  349. }
  350.                     ;will come here if we have already been to the regions
  351. Var2$ = ""
  352.    DIALOGBOX 60, 12, 207, 170, 17
  353.       LTEXT 55, 5, 108, 9, "States and Metros Selected"
  354.       FLISTBOX 8, 20, 90, 140, VAR1$, VAR2$
  355.       DEFPUSHBUTTON 130, 123, 47, 14, " &Complete "
  356.       PUSHBUTTON 130, 65, 47, 14, "&USA "
  357.       LTEXT 103, 33, 82, 9, "To return to USA map  "
  358.       LTEXT 103, 42, 94, 9, "for additional regional "
  359.       LTEXT 103, 50, 76, 9, "selections..."
  360.       LTEXT 103, 97, 93, 9, "When no more selections "
  361.       LTEXT 103, 106, 58, 9, "are desired..."
  362.    DEND
  363. cont_it:
  364. DO dg = DIALOG? UNTIL(dg != 255)
  365. if(dg==1) GOTO exit
  366. if(dg==200){
  367.         UPDATEDLG(0)
  368.         GOTO cont_it
  369. }
  370. us_test:
  371. i = object?
  372. IF(i == 1001) goto nope       ;this is where we test to see which hotspot has been selected
  373. ELSE IF(i == 1002) goto Mountain  ;just like processing menus
  374. ELSE IF(i == 1003) goto Plains 
  375. ELSE IF(i == 1004) goto nope 
  376. ELSE IF(i == 1005) goto AK_HI
  377. ELSE IF(i == 1006) goto AK_HI
  378. ELSE IF(i == 1007) goto nope
  379. ELSE IF(i == 1008) goto nope
  380. ELSE IF(i == 1009) goto NE
  381. ELSE IF(i == 1010) goto nope
  382.  
  383. goto us_test
  384.  
  385.  
  386. ;------------------------------------------------P L A I N S --------------------------------------
  387. plains:
  388. DELOBJECT(0,0,0)
  389. USERWINDOW(5,0,100,16776960)
  390. METABKG(0,0,1,"plains.wmf")
  391.     BUTTON(1352,1291,1258,608,"1001,&Fargo")
  392.     BUTTON(896,481,472,608,"1002,ND")
  393.     BUTTON(3019,1595,2217,608,"1003,Minneapolis-St. Paul")
  394.     BUTTON(3176,684,472,607,"1004,MN")
  395.     BUTTON(1038,2557,471,608,"1006,SD")
  396.     BUTTON(849,3873,472,608,"1009,NE")
  397.     BUTTON(1447,5823,471,607,"1017,KS")
  398.     BUTTON(3129,8177,472,608,"1020,OK")
  399.     BUTTON(3805,7595,472,608,"1022,AR")
  400.     BUTTON(3711,5139,471,608,"1015,MO")
  401.     BUTTON(3318,3899,471,607,"1011,IA")
  402.     BUTTON(1541,2684,1258,607,"1005,Sioux Falls")
  403.     BUTTON(1682,3924,1258,608,"1007,Omaha")
  404.     BUTTON(2154,5722,1337,607,"1012,Kansas City")
  405.     BUTTON(1289,6506,1258,608,"1016,Wichita")
  406.     BUTTON(1226,8380,1651,607,"1019,Oklahoma City")
  407.     BUTTON(2358,7139,1258,608,"1018,Tulsa")
  408.     BUTTON(4544,7949,1258,608,"1021,Little Rock")
  409.     BUTTON(3679,5899,1258,607,"1013,St. Louis")
  410.     BUTTON(3947,4203,1320,607,"1010,Des Moines")
  411.     BUTTON(1226,4658,1258,608,"1008,Lincoln")
  412.     BUTTON(4371,6608,1258,607,"1014,Springfield")
  413. SHOW(6)
  414.  
  415.    DIALOGBOX 275, 20, 159, 70, 28, "States and Metros"
  416.       LTEXT 30, 4, 108, 8, "States and Metros Selected"
  417.       FLISTBOX 8, 15, 92, 49, VAR1$, VAR2$
  418.       PUSHBUTTON 103, 22, 49, 14, "Remove "
  419.       PUSHBUTTON 103, 44, 49, 14, "USA Map"
  420.    DEND
  421.  
  422. plains_test:
  423. dg = DIALOG?            ;processing both dialog box and hotspot selection
  424. i = OBJECT?
  425. IF(i>0) goto get_HS1        ;a hotspot selected go find which one
  426. IF(dg==255) goto plains_test
  427. IF(dg==200){            ;something selected in list box. we just go back and look for
  428.         UPDATEDLG(0)        ;another selection.  var2$ now has the selection if we want to 
  429.         GOTO Plains_test        ;
  430. }                ;
  431. IF(dg==2){            ;remove it here
  432.     GOSUB remove
  433.     GOTO plains_test
  434. }
  435. DESTROYDLG            ;since this is a modless dialog box we must destroy it if either
  436.                 ;of the other pushbuttons are selected
  437. GOTO USA            ;redisplay the US map
  438.  
  439.  
  440. get_HS1:
  441.  
  442. IF(i == 1001) Var2$ = "ND-Fargo"
  443. ELSE IF(i == 1002)  Var2$ ="ND NORTH DAKOTA"
  444. ELSE IF(i == 1003)  Var2$ ="MN-Minneapolis/St. Paul"
  445. ELSE IF(i == 1004)  Var2$ ="MN MINNESOTA"
  446. ELSE IF(i == 1005)  Var2$ ="SD-Sioux Falls"
  447. ELSE IF(i == 1006)  Var2$ ="SD SOUTH DAKOTA"
  448. ELSE IF(i == 1007)  Var2$ ="NE-Omaha"
  449. ELSE IF(i == 1008)  Var2$ ="NE-Lincoln"
  450. ELSE IF(i == 1009)  Var2$ ="NE NEBRASKA"
  451. ELSE IF(i == 1010)  Var2$ ="IA-Des Moines"
  452. ELSE IF(i == 1011)  Var2$ ="IA IOWA"
  453. ELSE IF(i == 1012)  Var2$ ="MO-Kansas City"
  454. ELSE IF(i == 1013)  Var2$ ="MO-St. Louis"
  455. ELSE IF(i == 1014)  Var2$ ="MO-Springfield"
  456. ELSE IF(i == 1015)  Var2$ ="MO MISSOURI"
  457. ELSE IF(i == 1016)  Var2$ ="KS-Wichita"
  458. ELSE IF(i == 1017)  Var2$ ="KS KANSAS"
  459. ELSE IF(i == 1018)  Var2$ ="OK-Tulsa"
  460. ELSE IF(i == 1019)  Var2$ ="OK-Oklahoma City"
  461. ELSE IF(i == 1020)  Var2$ ="OK OKLAHOMA"
  462. ELSE IF(i == 1021)  Var2$ ="AR-Little Rock"
  463. ELSE IF(i == 1022)  Var2$ ="AR ARKANSAS"
  464.  
  465. finfo1 = FOPEN(2,Var1$)            ;add the selected
  466. fseek(finfo1,0,2)
  467. fwriteln(finfo1,Var2$)            ;state or city to
  468. fclose(finfo1)
  469. var2$ = ""                ;the file
  470. updatedlg(1)                ;display the change to the file in the list box
  471. goto plains_test
  472.  
  473. ;******** Alaska or Hawaii Selected **
  474. ;******** See Comments in Plains Section **
  475. ak_hi:
  476.  
  477. ;STATUSLINE("ALASKA OR HAWAII")
  478. DELOBJECT(0,0,0)
  479. USERWINDOW(5,1,100,16776960)
  480. METABKG(1,1,1,"ak_hi.wmf")
  481.     BUTTON(2028,2658,1258,608,"1003,Honolulu")
  482.     BUTTON(7248,4987,1258,608,"1001,&Anchorage")
  483.     BUTTON(2689,405,408,608,"1004,HI")
  484.     BUTTON(7657,3443,409,608,"1002,AK")
  485. SHOW(6)
  486.  
  487.    DIALOGBOX 20, 120, 166, 71, 28, "States and Metros"
  488.       LTEXT 30, 4, 108, 8, "States and Metros Selected"
  489.       FLISTBOX 8, 15, 92, 49, VAR1$, VAR2$
  490.       PUSHBUTTON 107, 32, 49, 14, "Remove "
  491.       PUSHBUTTON 108, 50, 49, 14, "USA Map"
  492.    DEND
  493.  
  494. akhi_test:
  495. dg = dialog?
  496. i = OBJECT?
  497. if(i>0) GOTO get_HS4
  498. if(dg==255) GOTO akhi_test
  499. if(dg==200){
  500.         updatedlg(0)
  501.         GOTO akhi_test
  502. }
  503. if(dg==2){
  504.     gosub remove
  505.     GOTO akhi_test
  506. }
  507. Destroydlg
  508. GOTO USA
  509.  
  510. get_HS4:
  511. IF(i == 1001) Var2$ ="AK-Anchorage"
  512. ELSE IF(i == 1002)  Var2$ ="AK ALASKA"
  513. ELSE IF(i == 1003)  Var2$ ="HI-Honolulu"
  514. ELSE IF(i == 1004)  Var2$ ="HI HAWAII"
  515.  
  516. finfo1 = FOPEN(2,Var1$)            ;add the selected
  517. fseek(finfo1,0,2)
  518. fwriteln(finfo1,Var2$)            ;state or city to
  519. fclose(finfo1)
  520. var2$ = ""                ;the file
  521. updatedlg(1)                ;display the change to the file in the list box
  522. GOTO  akhi_test
  523.  
  524. ;******* North East Region Selected **
  525. ;******* See Comments in Plains Section **
  526. NE:
  527. DELOBJECT(0,0,0)
  528. USERWINDOW(5,0,100,16776960)
  529. METABKG(0,0,1,"ne.wmf")
  530.     BUTTON(7893,4709,1258,607,"1013,Boston")
  531.     BUTTON(4403,5241,1257,607,"1001,&Buffalo")
  532.     BUTTON(4340,8000,1431,608,"1005,Philadelphia")
  533.     BUTTON(2453,7595,1257,608,"1004,Pittsburgh")
  534.     BUTTON(6557,6532,1257,607,"1008,Hartford")
  535.     BUTTON(6399,7316,1573,608,"1002,New York City")
  536.     BUTTON(7862,6127,1257,607,"1010,Providence")
  537.     BUTTON(7091,5063,425,608,"1012,MA")
  538.     BUTTON(8286,1899,425,607,"1016,ME")
  539.     BUTTON(5676,4380,456,607,"1003,NY")
  540.     BUTTON(4308,7139,362,608,"1006,PA")
  541.     BUTTON(5802,7291,472,608,"1007,NJ")
  542.     BUTTON(6352,5848,472,608,"1009,CT")
  543.     BUTTON(7421,5899,362,607,"1011,RI")
  544.     BUTTON(7138,4127,441,607,"1015,NH")
  545.     BUTTON(6494,4101,456,608,"1014,VT")
  546. SHOW(6)
  547.  
  548.    DIALOGBOX 18, 14, 166, 71, 28, "States and Metros"
  549.       LTEXT 30, 4, 108, 8, "States and Metros Selected"
  550.       FLISTBOX 8, 15, 92, 49, VAR1$, VAR2$
  551.       PUSHBUTTON 107, 32, 49, 14, "Remove "
  552.       PUSHBUTTON 107, 50, 49, 14, "USA Map"
  553.    DEND
  554.  
  555. NE_test:
  556. dg = dialog?
  557. i = OBJECT?
  558. if(i>0) GOTO  get_HS7
  559. if(dg==255) GOTO  NE_test
  560. if(dg==200){
  561.         updatedlg(0)
  562.         GOTO ne_test
  563. }
  564. if(dg==2){
  565.     gosub remove
  566.     GOTO ne_test
  567. }
  568. Destroydlg
  569.  
  570. GOTO USA
  571.  
  572. get_HS7:
  573. IF(i == 1001) Var2$ ="NY-Buffalo"
  574. ELSE IF(i == 1002) Var2$ = "NY-New York City"
  575. ELSE IF(i == 1003) Var2$ = "NY NEW YORK"
  576. ELSE IF(i == 1004) Var2$ = "PA-Pittsburgh"
  577. ELSE IF(i == 1005) Var2$ = "PA-Philadelphia"
  578. ELSE IF(i == 1006) Var2$ = "PA PENNSYLVANIA"
  579. ELSE IF(i == 1007) Var2$ = "NJ NEW JERSEY"
  580. ELSE IF(i == 1008) Var2$ = "CT-Hartford"
  581. ELSE IF(i == 1009) Var2$ = "CT CONNECTICUT"
  582. ELSE IF(i == 1010) Var2$ = "RI-Providence"
  583. ELSE IF(i == 1011) Var2$ = "RI RHODE ISLAND"
  584. ELSE IF(i == 1012) Var2$ = "MA MASSACHUSETTS"
  585. ELSE IF(i == 1013) Var2$ = "MA-Boston"
  586. ELSE IF(i == 1014) Var2$ = "VT VERMONT"
  587. ELSE IF(i == 1015) Var2$ = "NH NEW HAMPSHIRE"
  588. ELSE IF(i == 1016) Var2$ = "ME MAINE"
  589.  
  590. finfo1 = FOPEN(2,Var1$)            ;add the selected
  591. fseek(finfo1,0,2)
  592. fwriteln(finfo1,Var2$)            ;state or city to
  593. fclose(finfo1)
  594. var2$ = ""                ;the file
  595. updatedlg(1)                ;display the change to the file in the list box
  596. GOTO ne_test
  597.  
  598. ;******* Mountain Region Selected **
  599. ;******* See Comments in Plains Section **
  600. MOUNTAIN:
  601. DELOBJECT(0,0,0)
  602. USERWINDOW(5,0,100,16776960)
  603. METABKG(0,0,1,"mountain.wmf")
  604.     BUTTON(2437,1215,1258,608,"1001,&Billings")
  605.     BUTTON(3129,3646,1258,607,"1005,Cheyenne")
  606.     BUTTON(1714,2304,1258,607,"1003,Boise")
  607.     BUTTON(1855,4861,1526,607,"1007,Salt Lake City")
  608.     BUTTON(204,6506,1258,608,"1013,Las Vegas")
  609.     BUTTON(2374,9139,1258,607,"1016,Tucson")
  610.     BUTTON(802,7722,1258,608,"1015,Phoenix")
  611.     BUTTON(3742,7797,1462,608,"1011,Albuquerque")
  612.     BUTTON(3223,5519,1258,608,"1009,Denver")
  613.     BUTTON(3695,2810,472,608,"1006,WY")
  614.     BUTTON(4072,861,472,607,"1002,MT")
  615.     BUTTON(1619,1316,472,608,"1004,ID")
  616.     BUTTON(943,4582,472,608,"1014,NV")
  617.     BUTTON(2390,5595,472,608,"1008,UT")
  618.     BUTTON(2390,7114,472,608,"1017,AZ")
  619.     BUTTON(3381,6911,471,608,"1012,NM")
  620.     BUTTON(4780,5241,472,607,"1010,CO")
  621. SHOW(6)
  622.  
  623.    DIALOGBOX 275, 20, 159, 70, 28, "States and Metros"
  624.       LTEXT 30, 4, 108, 8, "States and Metros Selected"
  625.       FLISTBOX 8, 15, 92, 49, VAR1$, VAR2$
  626.       PUSHBUTTON 103, 22, 49, 14, "Remove "
  627.       PUSHBUTTON 103, 44, 49, 14, "USA Map"
  628.    DEND
  629.  
  630. MOUNTAIN_test:
  631. dg = dialog?
  632. i = OBJECT?
  633. if(i>0) GOTO get_HS9
  634. if(dg==255) GOTO mountain_test
  635. if(dg==200){
  636.         updatedlg(0)
  637.         GOTO mountain_test
  638. }
  639. if(dg==2){
  640.     GOSUB remove
  641.     GOTO mountain_test
  642. }
  643. Destroydlg
  644.  
  645. GOTO usa
  646.  
  647. get_hs9:
  648. IF(i == 1001) Var2$ ="MT-Billings"
  649. ELSE IF(i == 1002)  Var2$ ="MT MONTANA"
  650. ELSE IF(i == 1003)  Var2$ ="ID-Boise"
  651. ELSE IF(i == 1004)  Var2$ ="ID IDAHO"
  652. ELSE IF(i == 1005)  Var2$ ="WY-Cheyenne"
  653. ELSE IF(i == 1006)  Var2$ ="WY WYOMING"
  654. ELSE IF(i == 1007)  Var2$ ="UT-Salt Lake City"
  655. ELSE IF(i == 1008)  Var2$ ="UT UTAH"
  656. ELSE IF(i == 1009)  Var2$ ="CO-Denver"
  657. ELSE IF(i == 1010)  Var2$ ="CO COLORADO"
  658. ELSE IF(i == 1011)  Var2$ ="NM-Albuquerque"
  659. ELSE IF(i == 1012)  Var2$ ="NM NEW MEXICO"
  660. ELSE IF(i == 1013)  Var2$ ="NV-Las Vegas"
  661. ELSE IF(i == 1014)  Var2$ ="NV NEVADA"
  662. ELSE IF(i == 1015)  Var2$ ="AZ-Phoenix"
  663. ELSE IF(i == 1016)  Var2$ ="AZ-Tucson"
  664. ELSE IF(i == 1017)  Var2$ ="AZ ARIZONA"
  665.  
  666. finfo1 = FOPEN(2,Var1$)
  667. fseek(finfo1,0,2)
  668. fwriteln(finfo1,Var2$)
  669. fclose(finfo1)
  670. var2$ = ""
  671. updatedlg(1)
  672. goto MOUNTAIN_test
  673.  
  674.  
  675.  
  676. nope:
  677. alert("To save disk space for Demo purposes, only the Plains, North East, and Mountain Regions are available.")
  678. GOTO us_test
  679.  
  680. ;****** Subroutine to remove the selection in a FLISTBOX ***
  681. remove:
  682.         if(null(var2$) == true)return
  683.         temp = fopen(4096,"temp.txt")
  684.         recfdir = fopen(2,var1$)
  685.         fseek(recfdir,0,0)
  686.         dl_sel$ = freadln(recfdir)
  687.         while(null(dl_sel$) == false)
  688.                 if(cmp(left(dl_sel$,(len(dl_sel$) - 2)),var2$) == true) goto skip
  689.                 fwrite(temp,len(dl_sel$),dl_sel$)
  690.         skip:
  691.         dl_sel$ = freadln(recfdir)
  692.         wend
  693.         var2$ = ""
  694.         fclose(temp)
  695.         fclose(recfdir)
  696.         deletefile(var1$)
  697.         rename("temp.txt",var1$)
  698.         updatedlg(1)
  699.         return
  700.  
  701.     
  702. exit:
  703. DELOBJECT(0,0,0)
  704. DELETEFILE(var1$)    ;finished with the graphic hotspot demo
  705. SHOW(8)            ;show the cleared screen
  706. ENABLEMENU(m1,2,0)    ;re-enable the menu items
  707. ENABLEMENU(m1,3,0)
  708. ENABLEMENU(m1,4,0)
  709. ENABLEMENU(m1,5,0)
  710. ENABLEMENU(m1,6,0)
  711. ENABLEMENU(m1,7,0)
  712. SHOWBAR(m1)
  713. GOTO main_loop            ;go back to menu bar processing
  714.  
  715. end
  716.